<?php
namespace Home\Controller;
use Think\Controller;
class LogisticsController extends Controller {
    public function _initialize()
    {
        //自动加载的类
        new \Org\Autoload();
        $this->member_id = $this->member_info['member_id'];
        //echo $this->member_id;exit;
    }
    //首页
    public function index(){
        $data['title']='找物流 找金银网';
        $data['active']='logistics';
        $this->assign("data", $data);
        $this->display();
    }
    public function logistics_result(){
        $data['title']='找物流 找金银网';
        $data['active']='logistics';
        $this->assign("data", $data);
        $this->display();
    }

    //提交留言
    public function message_add_post() {
        if(!$this->member_id){
            echo "<script>alert('请您登录后再提交查询');window.location.href='/home/user/login';</script>";exit;
        }
        $post=I('post.');
        if (!$post['load_area']||!$post['unload_area']||!$post['goods']||!$post['weight']) {
            echo "<script>alert('提交信息信息不完整，请您填写完整后再提交');history.back(-1);</script>";exit;
        }
        $post['member_id']=$this->member_id;
        $post['add_time']=time();
        //print_r($post);exit;
        $Model=D("LogisticsMessage");
        $Model->post=$post;
        if(!$Model->message_add_post()){
            echo "<script>alert('提交失败，请您尝试重新提交');history.back(-1);</script>";exit;
        }
        echo "<script>alert('提交成功');history.back(-1);</script>";
    }

}